require("../css/yundong.less");

import * as echarts from 'echarts';


window.onload = function () {
    let fanhui = document.querySelector(".fnahui");
    fanhui.addEventListener("click", function () {
        history.back();
    })

    let tuD = document.querySelector(".tuj");

    let myCharts = echarts.init(tuD)

    let option = {
        title: {
            text: '近七天的运动时长'
        },
        tooltip: {},
        legend: {
            data: ['']
        },
        xAxis: {
            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周天']
        },
        yAxis: {},
        series: [
            {
                name: '数据',
                type: 'bar',
                data: [5, 80, 36, 30, 100, 20, 50]
            }
        ]
    }
    myCharts.setOption(option);



    let tuD1 = document.querySelector(".tuj1");

    let myCharts1 = echarts.init(tuD1);

    let option1 = {
        tooltip: {
            trigger: 'item'
        },
        legend: {
            top: '5%',
            left: 'center'
        },
        series: [
            {
                name: 'Access From',
                type: 'pie',
                radius: ['40%', '70%'],
                avoidLabelOverlap: false,
                itemStyle: {
                    borderRadius: 10,
                    borderColor: '#fff',
                    borderWidth: 2
                },
                label: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    label: {
                        show: true,
                        fontSize: '40',
                        fontWeight: 'bold'
                    }
                },
                labelLine: {
                    show: false
                },
                data: [
                    { value: 50, name: '周一' },
                    { value: 800, name: '周二' },
                    { value: 360, name: '周三' },
                    { value: 300, name: '周四' },
                    { value: 1000, name: '周五' },
                    { value: 200, name: '周六' },
                    { value: 500, name: '周日' }
                ]
            }
        ]
    };
    myCharts1.setOption(option1);

    let tuD2 = document.querySelector(".tuj2");
    let myCharts2 = echarts.init(tuD2);

    let option2 = {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [5, 80, 36, 30, 100, 20, 50],
            type: 'line'
          }
        ]
      };
      myCharts2.setOption(option2);













}